<!DOCTYPE html>
<html>
<head>
    <style>
        body {
            background: url("/img/cover/1.jpg");
            width: 100%;
        }
    </style>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="format-detection" content="telephone=no, email=no"/>
    <meta charset="UTF-8">
    <title>游记收藏</title>
    <link rel="stylesheet" href="/collect/css/core.css">
    <link rel="stylesheet" href="/collect/css/icon.css">
    <link rel="stylesheet" href="/collect/css/home.css">

    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
    <script type="text/javascript" src="/js/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="/collect/css/aui.js"></script>
    <script type="text/javascript" src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/plugins/form/jquery.form.js"></script>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script>
        $(function () {
            //定义起始的当前页为1
            var currentPage = 1;
            //定义总页数
            var pages;
            var travelData = [];

            function query() {
                $.get("/collects/content",{userId:1,collectState:1,pageSize:6,newsPageCollectId:1},function (data) {
                    //将总页数设置给pages
                    pages = data.pages;
                    $.merge(travelData, data.list);
                    var json = {
                        list: travelData
                    }
                    $(".travels").renderValues(json, {
                        getHref: function (item, value) {
                            var url = $(item).data('href');
                            $(item).attr("href", url + value);
                        }
                    });




                });
                //每查询一次当前页自增一次
                currentPage++;
            }

            query();

            $(window).scroll(function () {
                if ($(document).scrollTop() + $(window).height() >= $(document).height() - 1) {
                    if (currentPage <= pages) {
                        query();
                    } else {
                        $(document).dialog({
                            type: 'notice',
                            infoText: '已经到底了!',
                            autoClose: 1500,
                            position: 'center'  // center: 居中; bottom: 底部
                        });

                    }
                }
            })
        })


    </script>
</head>
<body style="background:#eee">

<header class="aui-header-default aui-header-fixed aui-header-bg">
    <a href="javascript:history.back(-1)" class="aui-header-item">
        <i class="aui-icon aui-icon-back-white"></i>
    </a>
    <div class="aui-header-center aui-header-center-clear">
        <div class="aui-header-center-logo">
            <div class="aui-car-white-Typeface">游记收藏</div>
        </div>
    </div>
    <a href="#" class="aui-header-item-icon" style="min-width:0">
        <!--<i class="aui-icon aui-icon-search"></i>-->
    </a>
</header>

<section class="aui-myOrder-content travels">
    <div render-loop="list">
        <div class="aui-Address-box">
            <div class="aui-Address-box-item">
                <a data-href="/newsContent.html?id=" render-key="list.newsPageCollect.id" render-fun="getHref">
                    <img render-src="list.newsPageCollect.coverUrl" width="100%">
                </a>
            </div>
            <div class="aui-Address-box-item">
                <div class="aui-Address-box-item-bd">
                    <h6 class="title" render-html="list.newsPageCollect.title"></h6>
                    <p>发布时间 <span render-html="list.collectTime"></span>
                        <span class="span-right">
							  <i class="fa fa-heart"></i><span class="totalNum" render-html="list.collect"></span>收藏
						  <i class="fa fa-thumbs-o-up"></i><span>2</span>点赞</span>
                    </p>
                </div>
            </div>
        </div>
    </div>
</section>
</body>
</html>